import { Component } from '@angular/core';
import {ProductService} from "./_services/product.service";

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(private productService: ProductService) {
    // add some initial products
    if (productService.getAll().length === 0) {
      productService.save({ name: 'Boardies', price: '25.00' });
      productService.save({ name: 'Singlet', price: '9.50' });
      productService.save({ name: 'Thongs (Flip Flops)', price: '12.95' });
    }
  }
}
